mw.loader.implement("ext.centralNotice.bannerController",function($,jQuery){(function($,mw){var rPlus=/\+/g;function decode(s){try{return decodeURIComponent(s.replace(rPlus,' '));}catch(e){return'';}}function synthesizeGeoCookie(){if(!window.Geo||!window.Geo.country){$.cookie('GeoIP','::::vx',{path:'/'});return;}var parts=[window.Geo.country,window.Geo.city.replace(/[^a-z]/i,'_'),window.Geo.lat,window.Geo.lon,(window.Geo.IP&&window.Geo.IP.match(':'))?'v6':'v4'];$.cookie('GeoIP',parts.join(':'),{path:'/'});}window.Geo=(function(match,country,city,lat,lon,af){if(typeof country!=='string'||(country.length!==0&&country.length!==2)){$.cookie('GeoIP',null,{path:'/'});country='';city='';lat='';lon='';af='vx';}return{country:country,city:city,lat:lat&&parseFloat(lat),lon:lon&&parseFloat(lon),af:af};}).apply(null,($.cookie('GeoIP')||'').match(/([^:]*):([^:]*):([^:]*):([^:]*):([^;]*)/)||[]);mw.centralNotice={data:{getVars:{},category:'default',bucket:null,testing:false},bannerData:{},
impressionData:{result:'show'},onlySampleRI:false,events:{},alreadyRan:false,deferredObjs:{},loadBanner:function(){if(mw.centralNotice.data.getVars.banner){mw.centralNotice.loadTestingBanner(mw.centralNotice.data.getVars.banner,'');}else{mw.centralNotice.loadRandomBanner();}},loadTestingBanner:function(bannerName,campaign){var bannerPageQuery,url;mw.centralNotice.data.testing=true;bannerPageQuery={banner:bannerName,campaign:campaign,uselang:mw.config.get('wgUserLanguage'),debug:mw.centralNotice.data.getVars.debug};url=new mw.Uri(mw.config.get('wgCentralSelectedBannerDispatcher'));url.extend(bannerPageQuery);$.ajax({url:url.toString(),dataType:'script',cache:true});},loadRandomBanner:function(){var fetchBannerQueryParams,scriptUrl;mw.centralNotice.chooseRandomBanner();if(mw.centralNotice.data.banner){fetchBannerQueryParams={banner:mw.centralNotice.data.banner,campaign:mw.centralNotice.data.campaign,uselang:mw.config.get('wgUserLanguage'),debug:mw.centralNotice.data.getVars.debug};
scriptUrl=new mw.Uri(mw.config.get('wgCentralSelectedBannerDispatcher'));scriptUrl.extend(fetchBannerQueryParams);$.ajax({url:scriptUrl.toString(),dataType:'script',cache:true});}else{mw.centralNotice.onlySampleRI=true;mw.centralNotice.insertBanner(false);}},chooseRandomBanner:function(){var randomCampaign,randomBanner;if(!mw.cnBannerControllerLib.isChoiceDataSet()){mw.log('No choice data received for CentralNotice banner selection.');return;}if(!mw.cnBannerControllerLib.choicesAvailable()){return;}mw.cnBannerControllerLib.filterChoiceData();if(!mw.cnBannerControllerLib.choicesAvailable()){return;}mw.cnBannerControllerLib.calculateCampaignAllocations();randomCampaign=mw.centralNotice.data.getVars.randomcampaign||Math.random();mw.cnBannerControllerLib.chooseCampaign(randomCampaign);if(!mw.cnBannerControllerLib.isAnyCampaignChosen()){return;}mw.cnBannerControllerLib.processBuckets();mw.cnBannerControllerLib.makePossibleBanners();if(!mw.cnBannerControllerLib.bannersAvailable()){return;}mw
.cnBannerControllerLib.calculateBannerAllocations();randomBanner=mw.centralNotice.data.getVars.randombanner||Math.random();mw.cnBannerControllerLib.chooseBanner(randomBanner);},insertBanner:function(bannerJson){window.insertBanner(bannerJson);},toggleNotice:function(){window.toggleNotice();},hideBanner:function(){window.hideBanner();},recordImpression:function(data){var sampleRate,url=new mw.Uri(mw.config.get('wgCentralBannerRecorder'));if(mw.centralNotice.onlySampleRI){sampleRate=mw.config.get('wgCentralNoticeSampleRate');if(Math.random()>sampleRate){return;}}else{sampleRate=1;}$.extend(data,{sampleRate:sampleRate});url.extend(data);if(navigator.sendBeacon){navigator.sendBeacon(url.toString());}else{setTimeout(function(){document.createElement('img').src=url.toString();},0);}},loadQueryStringVariables:function(){document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g,function(str,p1,p2){mw.centralNotice.data.getVars[decode(p1)]=decode(p2);});},getBucket:function(){mw.log(
'Legacy mw.bannerController.getBucket() is deprecated no-op.');return 0;},storeBucket:function(){mw.log('Legacy mw.bannerController.storeBucket() is deprecated no-op.');},initialize:function(){if(mw.centralNotice.alreadyRan){return;}mw.centralNotice.alreadyRan=true;mw.centralNotice.loadQueryStringVariables();mw.centralNotice.data.anonymous=(mw.config.get('wgUserName')===null);mw.centralNotice.data.country=mw.centralNotice.data.getVars.country||window.Geo.country||'XX';mw.centralNotice.data.addressFamily=(window.Geo.IPv6||window.Geo.af==='v6')?'IPv6':'IPv4';mw.centralNotice.isPreviewFrame=(mw.config.get('wgCanonicalSpecialPageName')==='BannerPreview');mw.centralNotice.data.device=mw.centralNotice.data.getVars.device||mw.config.get('wgMobileDeviceName','desktop');if(mw.config.get('wgNamespaceNumber')==-1&&!mw.centralNotice.isPreviewFrame){return;}mw.centralNotice.deferredObjs.bannerLoaded=$.Deferred();mw.centralNotice.events.bannerLoaded=mw.centralNotice.deferredObjs.bannerLoaded.promise
();$('#siteNotice').prepend('<div id="centralNotice"></div>');if(mw.centralNotice.data.country==='XX'){$.ajax({url:'//geoiplookup.wikimedia.org/',dataType:'script',cache:true}).always(function(){if(window.Geo&&window.Geo.country){mw.centralNotice.data.country=window.Geo.country;}else{mw.centralNotice.data.country='XX';}synthesizeGeoCookie();mw.centralNotice.loadBanner();});}else{mw.centralNotice.loadBanner();}}};window.insertBanner=function(bannerJson){var url,targets,durations,cookieName,cookieVal,deleteOld,now,parsedCookie,bucket;var impressionData=$.extend(mw.centralNotice.impressionData,{country:mw.centralNotice.data.country,uselang:mw.config.get('wgUserLanguage'),project:mw.config.get('wgNoticeProject'),db:mw.config.get('wgDBname'),anonymous:mw.centralNotice.data.anonymous,device:mw.centralNotice.data.device});if(!bannerJson){impressionData.result='hide';impressionData.reason='empty';}else{impressionData.banner=bannerJson.bannerName;impressionData.campaign=bannerJson.campaign;if(!
mw.centralNotice.data.getVars.banner){bucket=mw.cnBannerControllerLib.bucketsByCampaign[impressionData.campaign];impressionData.bucket=bucket.val;impressionData.bucketStart=bucket.start;impressionData.bucketEnd=bucket.end;}mw.centralNotice.data.category=encodeURIComponent(bannerJson.category);if(impressionData.result!=='hide'&&mw.centralNotice.data.testing===false){cookieName='centralnotice_hide_'+mw.centralNotice.data.category;cookieVal=$.cookie(cookieName);durations=mw.config.get('wgNoticeCookieDurations');now=new Date().getTime()/1000;deleteOld=(now>mw.config.get('wgNoticeOldCookieApocalypse'));if(cookieVal==='hide'&&deleteOld){$.cookie(cookieName,null,{path:'/'});}else if(cookieVal==='hide'){impressionData.result='hide';impressionData.reason='cookie';}else if(cookieVal!==null&&cookieVal.indexOf('{')===0){parsedCookie=JSON.parse(cookieVal);if(durations[parsedCookie.reason]&&now<parsedCookie.created+durations[parsedCookie.reason]){impressionData.result='hide';impressionData.reason=
parsedCookie.reason;}}}if(impressionData.result==='show'){mw.centralNotice.bannerData.bannerName=bannerJson.bannerName;$('div#centralNotice').attr('class',mw.html.escape('cn-'+mw.centralNotice.data.category)).prepend('<!--googleoff: all-->'+bannerJson.bannerHtml+'<!--googleon: all-->');if(bannerJson.autolink){url=new mw.Uri(mw.config.get('wgNoticeFundraisingUrl'));if((bannerJson.landingPages!==null)&&bannerJson.landingPages.length){targets=String(bannerJson.landingPages).split(',');if($.inArray(mw.centralNotice.data.country,mw.config.get('wgNoticeXXCountries'))!==-1){mw.centralNotice.data.country='XX';}url.extend({landing_page:targets[Math.floor(Math.random()*targets.length)].replace(/^\s+|\s+$/,''),utm_medium:'sitenotice',utm_campaign:bannerJson.campaign,utm_source:bannerJson.bannerName,language:mw.config.get('wgUserLanguage'),country:mw.centralNotice.data.country});$('#cn-landingpage-link').attr('href',url.toString());}}var bannerShown=true;if(typeof mw.centralNotice.bannerData.
alterImpressionData==='function'){bannerShown=mw.centralNotice.bannerData.alterImpressionData(impressionData);}else{impressionData.alterFunctionMissing=true;}if(!bannerShown){impressionData.result='hide';if(!impressionData.reason){impressionData.reason='alterImpressionData';}}}}if(!mw.centralNotice.data.testing){mw.centralNotice.recordImpression(impressionData);}mw.centralNotice.deferredObjs.bannerLoaded.resolve(impressionData);};window.hideBanner=function(){var d=new Date(),cookieVal={v:1,created:Math.floor(d.getTime()/1000),reason:'close'},duration=mw.config.get('wgNoticeCookieDurations').close;$('#centralNotice').hide();d.setSeconds(d.getSeconds()+duration);$.cookie('centralnotice_hide_'+mw.centralNotice.data.category,JSON.stringify(cookieVal),{expires:d,path:'/'});$.each(mw.config.get('wgNoticeHideUrls'),function(idx,value){(new Image()).src=value+'?'+$.param({'duration':duration,'category':mw.centralNotice.data.category,'reason':'close'});});};window.toggleNotice=function(){window
.hideBanner();};$(function(){mw.centralNotice.initialize();});})(jQuery,mediaWiki);},{"css":["@media print{#centralNotice{display:none}}\n/* cache key: zhwiki:resourceloader:filter:minify-css:7:ddb0c98a055632ae8e349c9cf48ac703 */"]});mw.loader.implement("ext.centralNotice.bannerController.lib",function($,jQuery){(function($,mw){function chooseObjInAllocatedArray(random,allocatedArray){var blockStart=0,i,obj,blockEnd;for(i=0;i<allocatedArray.length;i++){obj=allocatedArray[i];blockEnd=blockStart+obj.allocation;if((random>=blockStart)&&(random<blockEnd)){return obj;}blockStart=blockEnd;}return null;}mw.cnBannerControllerLib={BUCKET_COOKIE_NAME:'centralnotice_buckets_by_campaign',CAMPAIGN_STALENESS_LEEWAY:15,choiceData:null,campaign:null,bucketsByCampaign:null,possibleBanners:null,setChoiceData:function(choiceData){this.choiceData=choiceData;},isChoiceDataSet:function(){return this.choiceData!==null;},choicesAvailable:function(){return this.choiceData.length>0;},isAnyCampaignChosen:
function(){return this.campaign!==null;},bannersAvailable:function(){return this.possibleBanners.length>0;},calculateCampaignAllocations:function(){var i,campaign,campaignPriority,campaignsByPriority=[],priorities=[],priority,campaignsAtThisPriority,remainingAllocation=1,j,campaignsAtThisPriorityCount,currentFullAllocation,actualAllocation;if(this.choiceData.length===1){this.choiceData[0].allocation=this.choiceData[0].throttle/100;return;}for(i=0;i<this.choiceData.length;i++){campaign=this.choiceData[i];campaignPriority=campaign.preferred;if(!campaignsByPriority[campaignPriority]){campaignsByPriority[campaignPriority]=[];}campaignsByPriority[campaignPriority].push(campaign);}for(priority in campaignsByPriority){priorities.push(priority);}priorities.sort();priorities.reverse();for(i=0;i<priorities.length;i++){campaignsAtThisPriority=campaignsByPriority[priorities[i]];if(remainingAllocation<0.01){for(j=0;j<campaignsAtThisPriority.length;j++){campaignsAtThisPriority[j].allocation=0;}
continue;}campaignsAtThisPriority.sort(function(a,b){if(a.throttle<b.throttle){return-1;}if(a.throttle>b.throttle){return 1;}return 0;});campaignsAtThisPriorityCount=campaignsAtThisPriority.length;for(j=0;j<campaignsAtThisPriorityCount;j++){campaign=campaignsAtThisPriority[j];currentFullAllocation=remainingAllocation/(campaignsAtThisPriorityCount-j);actualAllocation=Math.min(currentFullAllocation,campaign.throttle/100);campaign.allocation=actualAllocation;remainingAllocation-=actualAllocation;}}},chooseCampaign:function(random){this.setCampaign(chooseObjInAllocatedArray(random,this.choiceData));},setCampaign:function(campaign){this.campaign=campaign;mw.centralNotice.data.campaign=campaign?campaign.name:null;},processBuckets:function(){var campaign=this.campaign,campaignName=campaign.name,campaignStartDate,bucket,bucketEndDate,retrievedBucketEndDate,val,extension=mw.config.get('wgCentralNoticePerCampaignBucketExtension'),now=new Date(),bucketsModified=false;campaignStartDate=new Date();
campaignStartDate.setTime(campaign.start*1000);bucketEndDate=new Date();bucketEndDate.setTime(campaign.end*1000);bucketEndDate.setUTCDate(bucketEndDate.getUTCDate()+extension);this.retrieveBuckets();bucket=this.bucketsByCampaign[campaignName];if(bucket&&bucketEndDate>now){retrievedBucketEndDate=new Date();retrievedBucketEndDate.setTime(bucket.end*1000);if(retrievedBucketEndDate.getTime()!==bucketEndDate.getTime()){bucket.end=bucketEndDate.getTime()/1000;bucketsModified=true;}}else{val=this.getRandomBucket();this.bucketsByCampaign[campaignName]={val:val,start:campaignStartDate.getTime()/1000,end:bucketEndDate.getTime()/1000};bucketsModified=true;}for(campaignName in this.bucketsByCampaign){bucketEndDate=new Date();bucketEndDate.setTime(this.bucketsByCampaign[campaignName].end*1000);if(bucketEndDate<now){delete this.bucketsByCampaign[campaignName];bucketsModified=true;}}if(bucketsModified){this.storeBuckets();}},retrieveBuckets:function(){var cookieVal=$.cookie(this.BUCKET_COOKIE_NAME);
if(cookieVal){this.bucketsByCampaign=JSON.parse(cookieVal);}else{this.bucketsByCampaign={};}},storeBuckets:function(){var now=new Date(),latestDate,campaignName,bucketEndDate;latestDate=now;for(campaignName in this.bucketsByCampaign){bucketEndDate=new Date();bucketEndDate.setTime(this.bucketsByCampaign[campaignName].end*1000);if(bucketEndDate>latestDate){latestDate=bucketEndDate;}}latestDate.setDate(latestDate.getDate()+1);$.cookie(this.BUCKET_COOKIE_NAME,JSON.stringify(this.bucketsByCampaign),{expires:latestDate,path:'/'});},getRandomBucket:function(){return Math.floor(Math.random()*mw.config.get('wgNoticeNumberOfControllerBuckets'));},filterChoiceData:function(){var i,campaign,j,banner,keepCampaign,filteredChoiceData=[],now=new Date(),campaignEndDateWLeeway;for(i=0;i<this.choiceData.length;i++){campaign=this.choiceData[i];keepCampaign=false;campaignEndDateWLeeway=new Date();campaignEndDateWLeeway.setTime((campaign.end*1000)+(this.CAMPAIGN_STALENESS_LEEWAY*60000));if(
campaignEndDateWLeeway<now){this.choiceData=[];return;}if(campaign.geotargeted&&($.inArray(mw.centralNotice.data.country,campaign.countries)===-1)){continue;}for(j=0;j<campaign.banners.length;j++){banner=campaign.banners[j];if(mw.centralNotice.data.anonymous&&!banner.display_anon){continue;}if(!mw.centralNotice.data.anonymous&&!banner.display_account){continue;}if($.inArray(mw.centralNotice.data.device,banner.devices)===-1){continue;}keepCampaign=true;break;}if(keepCampaign){filteredChoiceData.push(campaign);}}this.choiceData=filteredChoiceData;},makePossibleBanners:function(){var i,campaign,campaignName,banner;this.possibleBanners=[];campaign=this.campaign;campaignName=campaign.name;for(i=0;i<campaign.banners.length;i++){banner=campaign.banners[i];if(this.bucketsByCampaign[campaignName].val%campaign.bucket_count!==banner.bucket){continue;}if(mw.centralNotice.data.anonymous&&!banner.display_anon){continue;}if(!mw.centralNotice.data.anonymous&&!banner.display_account){continue;}if($.
inArray(mw.centralNotice.data.device,banner.devices)===-1){continue;}this.possibleBanners.push(banner);}},calculateBannerAllocations:function(){var i,banner,totalWeights=0;if(mw.cnBannerControllerLib.possibleBanners.length===1){mw.cnBannerControllerLib.possibleBanners[0].allocation=1;return;}for(i=0;i<this.possibleBanners.length;i++){totalWeights+=this.possibleBanners[i].weight;}for(i=0;i<this.possibleBanners.length;i++){banner=this.possibleBanners[i];banner.allocation=banner.weight/totalWeights;}},chooseBanner:function(random){this.setBanner(chooseObjInAllocatedArray(random,this.possibleBanners));},setBanner:function(banner){mw.centralNotice.data.banner=banner.name;}};})(jQuery,mediaWiki);});mw.loader.implement("ext.gadget.variant-link-fix",function($,jQuery){try{var ref,loc;ref=new mw.Uri(document.referrer);loc=new mw.Uri(location.href);if(/\.google\./.test(ref.host)&&/^\/zh(-[^/]+)?\//.test(loc.path)){loc.path=loc.path.replace(/^\/zh(-[^/]+)?\//,"/wiki/");location=loc.toString();}}
catch(e){};});mw.loader.implement("ext.uls.init",function($,jQuery){(function($,mw){'use strict';var hasOwn=Object.prototype.hasOwnProperty;mw.uls=mw.uls||{};mw.uls.previousLanguagesCookie='uls-previous-languages';mw.uls.previousLanguageAutonymCookie='uls-previous-language-autonym';mw.uls.languageSettingsModules=['ext.uls.inputsettings','ext.uls.displaysettings'];mw.uls.languageSelectionMethod=undefined;mw.uls.addEventLoggingTriggers=function(){mw.uls.languageSelectionMethod=undefined;$('#uls-map-block').on('click',function(){mw.uls.languageSelectionMethod='map';});$('#uls-languagefilter').on('keydown',function(){if($(this).val()===''){mw.uls.languageSelectionMethod='search';}});$('#uls-lcd-quicklist a').on('click',function(){mw.uls.languageSelectionMethod='common';});};mw.uls.changeLanguage=function(language){var uri=new mw.Uri(window.location.href),deferred=new $.Deferred();deferred.done(function(){uri.extend({setlang:language});window.location.href=uri.toString();});mw.hook(
'mw.uls.interface.language.change').fire(language,deferred);window.setTimeout(function(){deferred.resolve();},mw.config.get('wgULSEventLogging')*500);};mw.uls.setPreviousLanguages=function(previousLanguages){$.cookie(mw.uls.previousLanguagesCookie,JSON.stringify(previousLanguages),{path:'/'});};mw.uls.getPreviousLanguages=function(){var previousLanguages=$.cookie(mw.uls.previousLanguagesCookie);if(!previousLanguages){return[];}return JSON.parse(previousLanguages).slice(-5);};mw.uls.getBrowserLanguage=function(){return(window.navigator.language||window.navigator.userLanguage||'').split('-')[0];};mw.uls.getCountryCode=function(){return window.Geo&&(window.Geo.country||window.Geo.country_code);};mw.uls.getAcceptLanguageList=function(){return mw.config.get('wgULSAcceptLanguageList')||[];};mw.uls.getFrequentLanguageList=function(countryCode){var unique=[],list=[mw.config.get('wgUserLanguage'),mw.config.get('wgContentLanguage'),mw.uls.getBrowserLanguage()].concat(mw.uls.getPreviousLanguages(
)).concat(mw.uls.getAcceptLanguageList());countryCode=countryCode||mw.uls.getCountryCode();if(countryCode){list=list.concat($.uls.data.getLanguagesInTerritory(countryCode));}$.each(list,function(i,v){if($.inArray(v,unique)===-1){unique.push(v);}});unique=$.grep(unique,function(langCode){var target;if(hasOwn.call($.fn.uls.defaults.languages,langCode)){return true;}target=$.uls.data.isRedirect(langCode);if(target){return hasOwn.call($.fn.uls.defaults.languages,target);}return false;});return unique;};function isBrowserSupported(){var blacklist={'msie':[['<=',7]]};return!$.client.test(blacklist,null,true);}mw.uls.init=function(callback){if(!isBrowserSupported()){$('#pt-uls').hide();return;}if(callback){callback.call(this);}};$(document).ready(function(){mw.uls.init();});}(jQuery,mediaWiki));},{"css":[
".uls-menu a{cursor:pointer}.uls-menu.callout .caret-before{border-top:20px solid transparent;border-right:20px solid #C9C9C9;border-bottom:20px solid transparent;display:inline-block;left:-21px;top:30px;position:absolute}.uls-menu.callout .caret-after{border-top:20px solid transparent;border-right:20px solid #FCFCFC;border-bottom:20px solid transparent;display:inline-block;left:-20px;top:30px;position:absolute}.uls-ui-languages button{width:23%;text-overflow:ellipsis;margin-right:4%}button.uls-more-languages{width:auto}.settings-title{font-size:11pt}.settings-text{color:#555555;font-size:9pt}div.display-settings-block:hover .settings-text{color:#252525}\n/* cache key: zhwiki:resourceloader:filter:minify-css:7:22d1681fa868b4ff4fbcb1ec1e58a9ea */"]});mw.loader.implement("ext.uls.interface",function($,jQuery){(function($,mw){'use strict';function displaySettings(){var $displaySettingsTitle,displaySettingsText,$displaySettings;displaySettingsText=$.i18n('ext-uls-display-settings-desc');
$displaySettingsTitle=$('<div data-i18n="ext-uls-display-settings-title">').addClass('settings-title').attr('title',displaySettingsText);$displaySettings=$('<div>').addClass('display-settings-block').prop('id','display-settings-block').append($displaySettingsTitle.i18n());return $displaySettings;}function inputSettings(){var $inputSettingsTitle,inputSettingsText,$inputSettings;inputSettingsText=$.i18n('ext-uls-input-settings-desc');$inputSettingsTitle=$('<div data-i18n="ext-uls-input-settings-title">').addClass('settings-title').attr('title',inputSettingsText);$inputSettings=$('<div>').addClass('input-settings-block').prop('id','input-settings-block').append($inputSettingsTitle.i18n());return $inputSettings;}function addDisplaySettings(uls){var $displaySettings=displaySettings();uls.$menu.find('#uls-settings-block').append($displaySettings);$displaySettings.on('click',function(){var languagesettings=$displaySettings.data('languagesettings'),displaySettingsOptions={defaultModule:
'display'},ulsPosition=mw.config.get('wgULSPosition'),anonMode=(mw.user.isAnon()&&!mw.config.get('wgULSAnonCanChangeLanguage'));if(!languagesettings){if(ulsPosition==='personal'&&!anonMode){displaySettingsOptions.onClose=function(){uls.show();};}$.extend(displaySettingsOptions,uls.position());mw.loader.using(mw.uls.languageSettingsModules,function(){$displaySettings.languagesettings(displaySettingsOptions).click();});}mw.hook('mw.uls.settings.open').fire('uls');uls.hide();});}function addInputSettings(uls){var $inputSettings=inputSettings();uls.$menu.find('#uls-settings-block').append($inputSettings);$inputSettings.on('click',function(){var position=uls.position(),languagesettings=$inputSettings.data('languagesettings');if(!languagesettings){mw.loader.using(mw.uls.languageSettingsModules,function(){$inputSettings.languagesettings({defaultModule:'input',onClose:function(){uls.show();},top:position.top,left:position.left}).click();});}mw.hook('mw.uls.settings.open').fire('uls');uls.hide(
);});}function addAccessibilityFeatures($target){$target.attr({tabIndex:0,role:'button','aria-haspopup':true});$target.click(function(){$(this).css('outline','none');});$target.blur(function(){$(this).css('outline','');});$target.keydown(function(event){if(event.keyCode===13){$(this).click();event.preventDefault();event.stopPropagation();}});}function getUndoAutonym(code){var deferred=$.Deferred(),autonym=$.cookie(mw.uls.previousLanguageAutonymCookie);if(autonym){deferred.resolve(autonym);}else{mw.loader.using('jquery.uls.data',function(){deferred.resolve($.uls.data.getAutonym(code));});}return deferred.promise();}function showULSTooltip(){var previousLang,$ulsTrigger,anonMode,showUndo,newLanguage,previousLanguages,ulsPosition=mw.config.get('wgULSPosition'),currentLang=mw.config.get('wgUserLanguage'),rtlPage=$('body').hasClass('rtl'),tipsyGravity={personal:'n',interlanguage:rtlPage?'e':'w'};$ulsTrigger=(ulsPosition==='interlanguage')?$('.uls-settings-trigger'):$('.uls-trigger');
previousLanguages=mw.uls.getPreviousLanguages()||[];previousLang=previousLanguages.slice(-1)[0];newLanguage=currentLang!==previousLang;anonMode=(mw.user.isAnon()&&!mw.config.get('wgULSAnonCanChangeLanguage'));showUndo=!anonMode&&newLanguage&&previousLang!==undefined;if(newLanguage){previousLanguages.push(currentLang);mw.uls.setPreviousLanguages(previousLanguages);}if(!showUndo){$ulsTrigger.tipsy({gravity:tipsyGravity[ulsPosition]});return;}getUndoAutonym(previousLang).done(function(autonym){$ulsTrigger.tipsy({gravity:tipsyGravity[ulsPosition],delayOut:3000,html:true,fade:true,trigger:'manual',title:function(){var link;link=$('<a>').text(autonym).attr({href:'#','class':'uls-prevlang-link',lang:previousLang,dir:'auto'});link=$('<div>').html(link).html();return mw.message('ext-uls-undo-language-tooltip-text','$1').escaped().replace('$1',link);}});});$.cookie(mw.uls.previousLanguageAutonymCookie,mw.config.get('wgULSCurrentAutonym'),{path:'/'});function showTipsy(timeout){var tipsyTimer=0;
$ulsTrigger.tipsy('show');$('.tipsy').on('mouseover',function(){window.clearTimeout(tipsyTimer);});$('.tipsy').on('mouseout',function(){tipsyTimer=window.setTimeout(hideTipsy,timeout);});$('.tipsy').on('click',hideTipsy);$('a.uls-prevlang-link').on('click.ulstipsy',function(event){var deferred=$.Deferred();event.preventDefault();deferred.done(function(){mw.uls.changeLanguage(event.target.lang);});mw.hook('mw.uls.language.revert').fire(deferred);window.setTimeout(function(){deferred.resolve();},mw.config.get('wgULSEventLogging')*500);});tipsyTimer=window.setTimeout(hideTipsy,timeout);}function hideTipsy(){$ulsTrigger.tipsy('hide');}window.setTimeout(function(){showTipsy(6000);},700);$ulsTrigger.on('mouseover',function(){if(!$('.uls-menu:visible').length){showTipsy(3000);}});}$(document).ready(function(){mw.uls.init(function(){var $triggers,$pLang,$ulsTrigger=$('.uls-trigger'),rtlPage=$('body').hasClass('rtl'),anonMode=(mw.user.isAnon()&&!mw.config.get('wgULSAnonCanChangeLanguage')),
imeSelector=mw.config.get('wgULSImeSelectors').join(', '),ulsPosition=mw.config.get('wgULSPosition');if(ulsPosition==='interlanguage'){$pLang=$('#p-lang');$ulsTrigger=$('<span>').addClass('uls-settings-trigger');$pLang.prepend($ulsTrigger);$ulsTrigger=$('.uls-settings-trigger');$pLang.find('.uls-p-lang-dummy').remove();if(!$pLang.find('div ul').children().length){$pLang.find('h3').text(mw.msg('uls-plang-title-languages'));}$ulsTrigger.attr({title:mw.msg('ext-uls-select-language-settings-icon-tooltip')});$ulsTrigger.on('click',function(e,eventParams){var languagesettings=$ulsTrigger.data('languagesettings'),languageSettingsOptions;if(languagesettings){if(!languagesettings.shown){mw.hook('mw.uls.settings.open').fire(eventParams&&eventParams.source||'interlanguage');}}else{languageSettingsOptions={defaultModule:'display',onVisible:function(){var topRowHeight,caretHeight,caretWidth,$caretBefore=$('<span>').addClass('caret-before'),$caretAfter=$('<span>').addClass('caret-after'),
ulsTriggerWidth=this.$element.width(),ulsTriggerOffset=this.$element.offset();this.$window.addClass('callout');this.$window.prepend($caretBefore,$caretAfter);if(rtlPage){caretWidth=parseInt($caretBefore.css('border-left-width'),10);this.left=ulsTriggerOffset.left-this.$window.width()-caretWidth;}else{caretWidth=parseInt($caretBefore.css('border-right-width'),10);this.left=ulsTriggerOffset.left+ulsTriggerWidth+caretWidth;}topRowHeight=this.$window.find('.row').height();caretHeight=parseInt($caretBefore.css('top'),10);this.top=ulsTriggerOffset.top-topRowHeight-caretHeight/2;this.position();}};mw.loader.using(mw.uls.languageSettingsModules,function(){$ulsTrigger.languagesettings(languageSettingsOptions).click();});e.stopPropagation();}});}else if(anonMode){$ulsTrigger.on('click',function(e,eventParams){var languagesettings=$ulsTrigger.data('languagesettings');e.preventDefault();if(languagesettings){if(!languagesettings.shown){mw.hook('mw.uls.settings.open').fire(eventParams&&eventParams.
source||'personal');}}else{mw.loader.using(mw.uls.languageSettingsModules,function(){$ulsTrigger.languagesettings();$ulsTrigger.trigger('click',eventParams);});}});}else{$ulsTrigger.on('click',function(e,eventParams){var uls=$ulsTrigger.data('uls');e.preventDefault();if(uls){if(!uls.shown){mw.hook('mw.uls.settings.open').fire(eventParams&&eventParams.source||'personal');}}else{mw.loader.using('ext.uls.mediawiki',function(){$ulsTrigger.uls({quickList:function(){return mw.uls.getFrequentLanguageList();},onReady:function(){var uls=this;mw.loader.using(mw.uls.languageSettingsModules,function(){addDisplaySettings(uls);addInputSettings(uls);});},onSelect:function(language){mw.uls.changeLanguage(language);},onVisible:function(){mw.uls.addEventLoggingTriggers();}});window.setTimeout(function(){$ulsTrigger.trigger('click',eventParams);},0);});}});}$triggers=$('.uls-settings-trigger, .uls-trigger');addAccessibilityFeatures($triggers);$('#uls-preferences-link').text(mw.msg(
'ext-uls-language-settings-preferences-link')).click(function(){$ulsTrigger.trigger('click',{source:'preferences'});return false;});showULSTooltip();$('body').on('focus.imeinit',imeSelector,function(){var $input=$(this);$('body').off('.imeinit');mw.loader.using('ext.uls.ime',function(){mw.ime.setup();mw.ime.handleFocus($input);});});});});}(jQuery,mediaWiki));},{},{"ext-uls-language-settings-preferences-link":"\u66f4\u591a\u8bed\u8a00\u8bbe\u7f6e","ext-uls-select-language-settings-icon-tooltip":"\u8bed\u8a00\u8bbe\u7f6e","ext-uls-undo-language-tooltip-text":"\u8bed\u8a00\u5df2\u66f4\u6539\u81ea$1","uls-plang-title-languages":"\u8bed\u8a00"});mw.loader.implement("ext.uls.webfonts",function($,jQuery){(function($,mw){'use strict';var ulsPreferences,tofuSalt='\u0D00',tofuLanguages={};mw.webfonts=mw.webfonts||{};ulsPreferences=mw.uls.preferences();mw.webfonts.preferences={registry:{fonts:{},webfontsEnabled:mw.config.get('wgULSWebfontsEnabled')},isEnabled:function(){return this.registry.
webfontsEnabled;},enable:function(){this.registry.webfontsEnabled=true;},disable:function(){this.registry.webfontsEnabled=false;},setFont:function(language,font){this.registry.fonts[language]=font;},getFont:function(language){return this.registry.fonts[language];},save:function(callback){ulsPreferences=mw.uls.preferences();ulsPreferences.set('webfonts',this.registry);ulsPreferences.save(callback);},load:function(){mw.webfonts.preferences.registry=$.extend(this.registry,ulsPreferences.get('webfonts'));}};function detectTofu(text){var index,$fixture,width={},height={},length=Math.min(4,text.length),detected=false;if($.client.test({msie:false})){text=tofuSalt+text;}$fixture=$('<span>').css({fontSize:'72px',fontFamily:'sans-serif'}).appendTo('body');for(index=0;index<length;index++){$fixture.text(text[index]);width[index]=$fixture.width()||width[index-1];height[index]=$fixture.height();if(index>0&&(width[index]!==width[index-1]||height[index]!==height[index-1])){detected=false;break;}}
$fixture.remove();if(index===length){detected=true;}return detected;}mw.webfonts.setup=function(){var mediawikiFontRepository=$.webfonts.repository;mediawikiFontRepository.base=mw.config.get('wgULSFontRepositoryBasePath');$.extend($.fn.webfonts.defaults,{repository:mediawikiFontRepository,fontStack:$('body').css('font-family').split(/, /g),fontSelector:function(repository,language,classes){var font,autonym,defaultFont;if(!language){return null;}defaultFont=repository.defaultFont(language);if(classes&&$.inArray('autonym',classes)>=0){autonym=true;}font=mw.webfonts.preferences.getFont(language);if(!font||autonym){if((!defaultFont||defaultFont==='system')&&!autonym){return font;}if(tofuLanguages[language]===undefined){tofuLanguages[language]=detectTofu($.uls.data.getAutonym(language));if(tofuLanguages[language]){mw.log('tofu detected for '+language);mw.hook('mw.uls.webfonts.tofudetected').fire(language);}}if(tofuLanguages[language]){font=autonym?'Autonym':defaultFont;}else{font='system';}
}if(font==='system'){font=null;}return font;},exclude:(function(){var excludes=mw.config.get('wgULSNoWebfontsSelectors').join(', ');if(mw.user.options.get('editfont')!=='default'){excludes=excludes?excludes+',textarea':'textarea';}return excludes;}()),overridableFontFamilies:(function(){var headingFont=$('h1').css('font-family');return headingFont?[headingFont]:[];}())});setTimeout(function(){$('body').webfonts();$('body').data('webfonts').load('Autonym');},0);};$(document).ready(function(){mw.uls.init(function(){mw.webfonts.preferences.load();if(mw.webfonts.preferences.isEnabled()){mw.loader.using('ext.uls.webfonts.fonts',mw.webfonts.setup);}});});}(jQuery,mediaWiki));});mw.loader.implement("jquery.byteLength",function($,jQuery){jQuery.byteLength=function(str){return str.replace(/[\u0080-\u07FF\uD800-\uDFFF]/g,'**').replace(/[\u0800-\uD7FF\uE000-\uFFFF]/g,'***').length;};;});mw.loader.implement("jquery.cookie",function($,jQuery){(function($,document,undefined){var pluses=/\+/g;
function raw(s){return s;}function decoded(s){return unRfc2068(decodeURIComponent(s.replace(pluses,' ')));}function unRfc2068(value){if(value.indexOf('"')===0){value=value.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}return value;}function fromJSON(value){return config.json?JSON.parse(value):value;}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null){options.expires=-1;}if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}value=config.json?JSON.stringify(value):String(value);return(document.cookie=[encodeURIComponent(key),'=',config.raw?value:encodeURIComponent(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}var decode=config.raw?raw:decoded;var cookies=document.cookie.split('; ');var
result=key?null:{};for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=decode(parts.join('='));if(key&&key===name){result=fromJSON(cookie);break;}if(!key){result[name]=fromJSON(cookie);}}return result;};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)!==null){$.cookie(key,null,options);return true;}return false;};})(jQuery,document);});mw.loader.implement("jquery.mwExtension",function($,jQuery){(function($){$.extend({trimLeft:function(str){return str===null?'':str.toString().replace(/^\s+/,'');},trimRight:function(str){return str===null?'':str.toString().replace(/\s+$/,'');},ucFirst:function(str){return str.charAt(0).toUpperCase()+str.slice(1);},escapeRE:function(str){return str.replace(/([\\{}()|.?*+\-\^$\[\]])/g,'\\$1');},isDomElement:function(el){return!!el&&!!el.nodeType;},isEmpty:function(v){var key;if(v===''||v===0||v==='0'||v===null||v===false||v===undefined){return true;}if(v.length===0){return true
;}if(typeof v==='object'){for(key in v){return false;}return true;}return false;},compareArray:function(arrThis,arrAgainst){if(arrThis.length!==arrAgainst.length){return false;}for(var i=0;i<arrThis.length;i++){if($.isArray(arrThis[i])){if(!$.compareArray(arrThis[i],arrAgainst[i])){return false;}}else if(arrThis[i]!==arrAgainst[i]){return false;}}return true;},compareObject:function(objectA,objectB){var prop,type;if(typeof objectA===typeof objectB){if(typeof objectA==='object'){if(objectA===objectB){return true;}else{for(prop in objectA){if(prop in objectB){type=typeof objectA[prop];if(type===typeof objectB[prop]){switch(type){case'object':if(!$.compareObject(objectA[prop],objectB[prop])){return false;}break;case'function':if(objectA[prop].toString()!==objectB[prop].toString()){return false;}break;default:if(objectA[prop]!==objectB[prop]){return false;}break;}}else{return false;}}else{return false;}}for(prop in objectB){if(!(prop in objectA)){return false;}}}}}else{return false;}return true
;}});}(jQuery));});mw.loader.implement("jquery.throttle-debounce",function($,jQuery){(function(window,undefined){'$:nomunge';var $=window.jQuery||window.Cowboy||(window.Cowboy={}),jq_throttle;$.throttle=jq_throttle=function(delay,no_trailing,callback,debounce_mode){var timeout_id,last_exec=0;if(typeof no_trailing!=='boolean'){debounce_mode=callback;callback=no_trailing;no_trailing=undefined;}function wrapper(){var that=this,elapsed=+new Date()-last_exec,args=arguments;function exec(){last_exec=+new Date();callback.apply(that,args);};function clear(){timeout_id=undefined;};if(debounce_mode&&!timeout_id){exec();}timeout_id&&clearTimeout(timeout_id);if(debounce_mode===undefined&&elapsed>delay){exec();}else if(no_trailing!==true){timeout_id=setTimeout(debounce_mode?clear:exec,debounce_mode===undefined?delay-elapsed:delay);}};if($.guid){wrapper.guid=callback.guid=callback.guid||$.guid++;}return wrapper;};$.debounce=function(delay,at_begin,callback){return callback===undefined?jq_throttle(
delay,at_begin,false):jq_throttle(delay,callback,at_begin!==false);};})(this);});mw.loader.implement("jquery.tipsy",function($,jQuery){(function(mw,$){function maybeCall(thing,ctx){return(typeof thing=='function')?(thing.call(ctx)):thing;}function Tipsy(element,options){this.$element=$(element);this.options=options;this.enabled=true;this.fixTitle();}Tipsy.prototype={show:function(){var title=this.getTitle();if(title&&this.enabled){var $tip=this.tip();$tip.find('.tipsy-inner')[this.options.html?'html':'text'](title);$tip[0].className='tipsy';if(this.options.className){$tip.addClass(maybeCall(this.options.className,this.$element[0]));}$tip.remove().css({top:0,left:0,visibility:'hidden',display:'block'}).appendTo(document.body);var pos=$.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var gravity=(typeof this.options.gravity=='function')?this.options.gravity.call(this.$element[0]):this.options.gravity;$tip.addClass('tipsy-'+
gravity);if(this.options.className){$tip.addClass(maybeCall(this.options.className,this.$element[0]));}var actualWidth=$tip[0].offsetWidth,actualHeight=$tip[0].offsetHeight;var tp;switch(gravity.charAt(0)){case'n':tp={top:pos.top+pos.height+this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case's':tp={top:pos.top-actualHeight-this.options.offset,left:pos.left+pos.width/2-actualWidth/2};break;case'e':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth-this.options.offset};break;case'w':tp={top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width+this.options.offset};break;}if(gravity.length==2){if(gravity.charAt(1)=='w'){if(this.options.center){tp.left=pos.left+pos.width/2-15;}else{tp.left=pos.left;}}else{if(this.options.center){tp.left=pos.left+pos.width/2-actualWidth+15;}else{tp.left=pos.left+pos.width;}}}$tip.css(tp);if(this.options.fade){$tip.stop().css({opacity:0,display:'block',visibility:'visible'}).animate({opacity:this.options.opacity},
100);}else{$tip.css({visibility:'visible',opacity:this.options.opacity});}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(100,function(){$(this).remove();});}else{this.tip().remove();}},fixTitle:function(){var $e=this.$element;if($e.attr('title')||typeof($e.attr('original-title'))!='string'){$e.attr('original-title',$e.attr('title')||'').removeAttr('title');}},getTitle:function(){var title,$e=this.$element,o=this.options;this.fixTitle();if(typeof o.title=='string'){title=$e.attr(o.title=='title'?'original-title':o.title);}else if(typeof o.title=='function'){title=o.title.call($e[0]);}title=(''+title).replace(/(^\s*|\s*$)/,"");return title||o.fallback;},tip:function(){if(!this.$tip){this.$tip=$('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');}return this.$tip;},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null;}},enable:function(){this.enabled=true;},disable:
function(){this.enabled=false;},toggleEnabled:function(){this.enabled=!this.enabled;}};$.fn.tipsy=function(options){if(options===true){return this.data('tipsy');}else if(typeof options=='string'){var tipsy=this.data('tipsy');if(tipsy)tipsy[options]();return this;}options=$.extend({},$.fn.tipsy.defaults,options);function get(ele){var tipsy=$.data(ele,'tipsy');if(!tipsy){tipsy=new Tipsy(ele,$.fn.tipsy.elementOptions(ele,options));$.data(ele,'tipsy',tipsy);}return tipsy;}function enter(){var tipsy=get(this);tipsy.hoverState='in';if(options.delayIn==0){tipsy.show();}else{tipsy.fixTitle();setTimeout(function(){if(tipsy.hoverState=='in')tipsy.show();},options.delayIn);}};function leave(){var tipsy=get(this);tipsy.hoverState='out';if(options.delayOut==0){tipsy.hide();}else{setTimeout(function(){if(tipsy.hoverState=='out')tipsy.hide();},options.delayOut);}};if(!options.live)this.each(function(){get(this);});if(options.trigger!='manual'){var eventIn=options.trigger=='hover'?'mouseenter':'focus'
,eventOut=options.trigger=='hover'?'mouseleave':'blur';if(options.live){mw.track('mw.deprecate','tipsy-live');mw.log.warn('Use of the "live" option of jquery.tipsy is deprecated.');$(this.context).on(eventIn,this.selector,enter).on(eventOut,this.selector,leave);}else{this.on(eventIn,enter).on(eventOut,leave);}}return this;};$.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:true,fallback:'',gravity:'n',center:true,html:false,live:false,offset:0,opacity:1.0,title:'title',trigger:'hover'};$.fn.tipsy.elementOptions=function(ele,options){return $.metadata?$.extend({},options,$(ele).metadata()):options;};$.fn.tipsy.autoNS=function(){return $(this).offset().top>($(document).scrollTop()+$(window).height()/2)?'s':'n';};$.fn.tipsy.autoWE=function(){return $(this).offset().left>($(document).scrollLeft()+$(window).width()/2)?'e':'w';};$.fn.tipsy.autoBounds=function(margin,prefer){return function(){var dir={ns:prefer[0],ew:(prefer.length>1?prefer[1]:false)},boundTop=$(document).
scrollTop()+margin,boundLeft=$(document).scrollLeft()+margin,$this=$(this);if($this.offset().top<boundTop)dir.ns='n';if($this.offset().left<boundLeft)dir.ew='w';if($(window).width()+$(document).scrollLeft()-$this.offset().left<margin)dir.ew='e';if($(window).height()+$(document).scrollTop()-$this.offset().top<margin)dir.ns='s';return dir.ns+(dir.ew?dir.ew:'');}};}(mediaWiki,jQuery));},{"css":[
".tipsy{padding:5px;position:absolute;z-index:100000;cursor:default}.tipsy-inner{padding:5px 8px 4px 8px; background-color:#ffffff;border:solid 1px #a7d7f9;color:black;max-width:15em;border-radius:4px; }.tipsy-arrow{position:absolute;background:url() no-repeat top left;background:url(//zh.wikipedia.org/static/1.26wmf5/resources/src/jquery.tipsy/images/tipsy.png?2015-05-06T18:43:20Z) no-repeat top left!ie;width:11px;height:6px} .tipsy-n .tipsy-arrow{top:0px;left:50%;margin-left:-5px} .tipsy-nw .tipsy-arrow{top:1px;left:10px} .tipsy-ne .tipsy-arrow{top:1px;right:10px} .tipsy-s .tipsy-arrow{bottom:0px;left:50%;margin-left:-5px;background-position:bottom left} .tipsy-sw .tipsy-arrow{bottom:0px;left:10px;background-position:bottom left} .tipsy-se .tipsy-arrow{bottom:0px;right:10px;background-position:bottom left} .tipsy-e .tipsy-arrow{top:50%;margin-top:-5px;right:1px;width:5px;height:11px;background-position:top right} .tipsy-w .tipsy-arrow{top:50%;margin-top:-5px;left:0px;width:6px;height:11px} .tipsy{font-size:0.8em}\n/* cache key: zhwiki:resourceloader:filter:minify-css:7:5522bee350c15d2c43501e016edd1c83 */"
]});mw.loader.implement("mediawiki.Title",function($,jQuery){(function(mw,$){function Title(title,namespace){var parsed=parse(title,namespace);if(!parsed){throw new Error('Unable to parse title');}this.namespace=parsed.namespace;this.title=parsed.title;this.ext=parsed.ext;this.fragment=parsed.fragment;return this;}var NS_MAIN=0,NS_TALK=1,NS_SPECIAL=-1,NS_MEDIA=-2,NS_FILE=6,FILENAME_MAX_BYTES=240,TITLE_MAX_BYTES=255,getNsIdByName=function(ns){var id;if(typeof ns!=='string'){return false;}ns=ns.toLowerCase();id=mw.config.get('wgNamespaceIds')[ns];if(id===undefined){return false;}return id;},rUnderscoreTrim=/^_+|_+$/g,rSplit=/^(.+?)_*:_*(.*)$/,rInvalid=new RegExp('[^'+mw.config.get('wgLegalTitleChars')+']'+'|%[0-9A-Fa-f]{2}'+'|&[A-Za-z0-9\u0080-\uFFFF]+;'+'|&#[0-9]+;'+'|&#x[0-9A-Fa-f]+;'),rWhitespace=/[ _\u0009\u00A0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\s]+/g,sanitationRules=[{pattern:/~{3}/g,replace:'',generalRule:true},{pattern:rWhitespace,replace:' ',generalRule:true}
,{pattern:/[\u200E\u200F\u202A-\u202E]/g,replace:'',generalRule:true},{pattern:/[\x00-\x1f\x7f]/g,replace:'',generalRule:true},{pattern:/%([0-9A-Fa-f]{2})/g,replace:'% $1',generalRule:true},{pattern:/&(([A-Za-z0-9\x80-\xff]+|#[0-9]+|#x[0-9A-Fa-f]+);)/g,replace:'& $1',generalRule:true},{pattern:/[:\/#]/g,replace:'-',fileRule:true},{pattern:/[\]\}>]/g,replace:')',generalRule:true},{pattern:/[\[\{<]/g,replace:'(',generalRule:true},{pattern:new RegExp(rInvalid.source,'g'),replace:'-',generalRule:true},{pattern:/^(\.|\.\.|\.\/.*|\.\.\/.*|.*\/\.\/.*|.*\/\.\.\/.*|.*\/\.|.*\/\.\.)$/g,replace:'',generalRule:true}],parse=function(title,defaultNamespace){var namespace,m,id,i,fragment,ext;namespace=defaultNamespace===undefined?NS_MAIN:defaultNamespace;title=title.replace(/[ _\s]+/g,'_').replace(rUnderscoreTrim,'');if(title!==''&&title.charAt(0)===':'){namespace=NS_MAIN;title=title.slice(1).replace(rUnderscoreTrim,'');}if(title===''){return false;}m=title.match(rSplit);if(m){id=getNsIdByName(m[1]);
if(id!==false){namespace=id;title=m[2];if(namespace===NS_TALK&&(m=title.match(rSplit))){if(getNsIdByName(m[1])!==false){return false;}}}}i=title.indexOf('#');if(i===-1){fragment=null;}else{fragment=title.slice(i+1).replace(/_/g,' ');title=title.slice(0,i).replace(rUnderscoreTrim,'');}if(title.match(rInvalid)){return false;}if(title.indexOf('.')!==-1&&(title==='.'||title==='..'||title.indexOf('./')===0||title.indexOf('../')===0||title.indexOf('/./')!==-1||title.indexOf('/../')!==-1||title.slice(-2)==='/.'||title.slice(-3)==='/..')){return false;}if(title.indexOf('~~~')!==-1){return false;}if(namespace!==NS_SPECIAL&&$.byteLength(title)>TITLE_MAX_BYTES){return false;}if(title===''&&namespace!==NS_MAIN){return false;}if(title.charAt(0)===':'){return false;}i=title.lastIndexOf('.');if(i===-1||title.length<=i+1){ext=null;}else{ext=title.slice(i+1);title=title.slice(0,i);}return{namespace:namespace,title:title,ext:ext,fragment:fragment};},text=function(s){if(s!==null&&s!==undefined){return s.
replace(/_/g,' ');}else{return'';}},sanitize=function(s,filter){var i,ruleLength,rule,m,filterLength,rules=sanitationRules;for(i=0,ruleLength=rules.length;i<ruleLength;++i){rule=rules[i];for(m=0,filterLength=filter.length;m<filterLength;++m){if(rule[filter[m]]){s=s.replace(rule.pattern,rule.replace);}}}return s;},trimToByteLength=function(s,length){var byteLength,chopOffChars,chopOffBytes;s=s.substr(0,length);while((byteLength=$.byteLength(s))>length){chopOffBytes=byteLength-length;chopOffChars=Math.max(1,Math.floor(chopOffBytes/4));s=s.substr(0,s.length-chopOffChars);}return s;},trimFileNameToByteLength=function(name,extension){return trimToByteLength(name,FILENAME_MAX_BYTES-extension.length-1)+'.'+extension;},createObject=Object.create||(function(){return function(o){function Title(){}if(o!==Object(o)){throw new Error('Cannot inherit from a non-object');}Title.prototype=o;return new Title();};}());Title.newFromText=function(title,namespace){var t,parsed=parse(title,namespace);if(!
parsed){return null;}t=createObject(Title.prototype);t.namespace=parsed.namespace;t.title=parsed.title;t.ext=parsed.ext;t.fragment=parsed.fragment;return t;};Title.newFromUserInput=function(title,defaultNamespace,options){var namespace,m,id,ext,parts,normalizeExtension;if(arguments.length<3&&$.type(defaultNamespace)==='object'){options=defaultNamespace;defaultNamespace=undefined;}options=$.extend({fileExtension:'',forUploading:true},options);normalizeExtension=function(extension){extension=extension.toLowerCase().replace(/\s*$/,'');return extension;};namespace=defaultNamespace===undefined?NS_MAIN:defaultNamespace;title=$.trim(title.replace(rWhitespace,' '));if(title!==''&&title.charAt(0)===':'){namespace=NS_MAIN;title=title.substr(1).replace(rUnderscoreTrim,'');}m=title.match(rSplit);if(m){id=getNsIdByName(m[1]);if(id!==false){namespace=id;title=m[2];}}if(namespace===NS_MEDIA||((options.forUploading||options.fileExtension)&&(namespace===NS_FILE))){title=sanitize(title,['generalRule',
'fileRule']);parts=title.split('.');if(parts.length>1){ext=parts.pop();if(options.fileExtension&&normalizeExtension(ext)!==normalizeExtension(options.fileExtension)){parts.push(ext);ext=options.fileExtension;}title=$.trim(parts.join('.'));title=trimFileNameToByteLength(title,ext);}else{title=$.trim(parts.join('.'));if(options.fileExtension){title=trimFileNameToByteLength(title,options.fileExtension);}else{return null;}}}else{title=sanitize(title,['generalRule']);if(namespace!==NS_SPECIAL){title=trimToByteLength(title,TITLE_MAX_BYTES);}}title=title.replace(/^\:+/,'');return Title.newFromText(title,namespace);};Title.newFromFileName=function(uncleanName,fileExtension){return Title.newFromUserInput('File:'+uncleanName,{fileExtension:fileExtension,forUploading:true});};Title.newFromImg=function(img){var matches,i,regex,src,decodedSrc,thumbPhpRegex=/thumb\.php/,regexes=[/\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[^\s\/]+-(?:\1|thumbnail)[^\s\/]*$/,
/\/([^\s\/]+)\/[^\s\/]+-(?:\1|thumbnail)[^\s\/]*$/,/\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)$/,/\/([^\s\/]+)$/],recount=regexes.length;src=img.jquery?img[0].src:img.src;matches=src.match(thumbPhpRegex);if(matches){return mw.Title.newFromText('File:'+mw.util.getParamValue('f',src));}decodedSrc=decodeURIComponent(src);for(i=0;i<recount;i++){regex=regexes[i];matches=decodedSrc.match(regex);if(matches&&matches[1]){return mw.Title.newFromText('File:'+matches[1]);}}return null;};Title.exists=function(title){var match,type=$.type(title),obj=Title.exist.pages;if(type==='string'){match=obj[title];}else if(type==='object'&&title instanceof Title){match=obj[title.toString()];}else{throw new Error('mw.Title.exists: title must be a string or an instance of Title');}if(typeof match==='boolean'){return match;}return null;};Title.exist={pages:{},set:function(titles,state){titles=$.isArray(titles)?titles:[titles];state=state===undefined?true:!!state;var i,pages=this.pages,len=titles.length;for(i=0;i<len;i++
){pages[titles[i]]=state;}return true;}};Title.prototype={constructor:Title,getNamespaceId:function(){return this.namespace;},getNamespacePrefix:function(){return this.namespace===NS_MAIN?'':(mw.config.get('wgFormattedNamespaces')[this.namespace].replace(/ /g,'_')+':');},getName:function(){if($.inArray(this.namespace,mw.config.get('wgCaseSensitiveNamespaces'))!==-1){return this.title;}else{return $.ucFirst(this.title);}},getNameText:function(){return text(this.getName());},getExtension:function(){return this.ext;},getDotExtension:function(){return this.ext===null?'':'.'+this.ext;},getMain:function(){return this.getName()+this.getDotExtension();},getMainText:function(){return text(this.getMain());},getPrefixedDb:function(){return this.getNamespacePrefix()+this.getMain();},getPrefixedText:function(){return text(this.getPrefixedDb());},getRelativeText:function(namespace){if(this.getNamespaceId()===namespace){return this.getMainText();}else if(this.getNamespaceId()===NS_MAIN){return':'+
this.getPrefixedText();}else{return this.getPrefixedText();}},getFragment:function(){return this.fragment;},getUrl:function(params){return mw.util.getUrl(this.toString(),params);},exists:function(){return Title.exists(this);}};Title.prototype.toString=Title.prototype.getPrefixedDb;Title.prototype.toText=Title.prototype.getPrefixedText;mw.Title=Title;}(mediaWiki,jQuery));});mw.loader.implement("mediawiki.user",function($,jQuery){(function(mw,$){var i,deferreds={},byteToHex=[];function getUserInfo(info){var api;if(!deferreds[info]){deferreds.rights=$.Deferred();deferreds.groups=$.Deferred();api=new mw.Api();api.get({action:'query',meta:'userinfo',uiprop:'rights|groups'}).always(function(data){var rights,groups;if(data.query&&data.query.userinfo){rights=data.query.userinfo.rights;groups=data.query.userinfo.groups;}deferreds.rights.resolve(rights||[]);deferreds.groups.resolve(groups||[]);});}return deferreds[info].promise();}for(i=0;i<256;i++){byteToHex[i]=(i+256).toString(16).slice(1);}$.
extend(mw.user,{generateRandomSessionId:function(){var rnds,i,r,hexRnds=new Array(8),crypto=window.crypto||window.msCrypto;if(crypto&&crypto.getRandomValues){rnds=new Uint8Array(8);crypto.getRandomValues(rnds);}else{rnds=new Array(8);for(i=0;i<8;i++){if((i&3)===0){r=Math.random()*0x100000000;}rnds[i]=r>>>((i&3)<<3)&255;}}for(i=0;i<8;i++){hexRnds[i]=byteToHex[rnds[i]];}return hexRnds.join('');},getId:function(){return mw.config.get('wgUserId',0);},getName:function(){return mw.config.get('wgUserName');},getRegistration:function(){var registration=mw.config.get('wgUserRegistration');if(mw.user.isAnon()){return false;}if(registration===null){return null;}return new Date(registration);},isAnon:function(){return mw.user.getName()===null;},sessionId:function(){var sessionId=$.cookie('mediaWiki.user.sessionId');if(sessionId===undefined||sessionId===null){sessionId=mw.user.generateRandomSessionId();$.cookie('mediaWiki.user.sessionId',sessionId,{expires:null,path:'/'});}return sessionId;},id:
function(){return mw.user.getName()||mw.user.sessionId();},bucket:function(key,options){var cookie,parts,version,bucket,range,k,rand,total;options=$.extend({buckets:{},version:0,expires:30},options||{});cookie=$.cookie('mediaWiki.user.bucket:'+key);if(typeof cookie==='string'&&cookie.length>2&&cookie.indexOf(':')!==-1){parts=cookie.split(':');if(parts.length>1&&Number(parts[0])===options.version){version=Number(parts[0]);bucket=String(parts[1]);}}if(bucket===undefined){if(!$.isPlainObject(options.buckets)){throw new Error('Invalid bucket. Object expected for options.buckets.');}version=Number(options.version);range=0;for(k in options.buckets){range+=options.buckets[k];}rand=Math.random()*range;total=0;for(k in options.buckets){bucket=k;total+=options.buckets[k];if(total>=rand){break;}}$.cookie('mediaWiki.user.bucket:'+key,version+':'+bucket,{path:'/',expires:Number(options.expires)});}return bucket;},getGroups:function(callback){return getUserInfo('groups').done(callback);},getRights:
function(callback){return getUserInfo('rights').done(callback);}});}(mediaWiki,jQuery));});mw.loader.implement("mediawiki.util",function($,jQuery){(function(mw,$){'use strict';var util={init:function(){util.$content=(function(){var i,l,$node,selectors;selectors=['.mw-body-primary','.mw-body','#mw-content-text','body'];for(i=0,l=selectors.length;i<l;i++){$node=$(selectors[i]);if($node.length){return $node.first();}}return util.$content;}());},rawurlencode:function(str){str=String(str);return encodeURIComponent(str).replace(/!/g,'%21').replace(/'/g,'%27').replace(/\(/g,'%28').replace(/\)/g,'%29').replace(/\*/g,'%2A').replace(/~/g,'%7E');},wikiUrlencode:function(str){return util.rawurlencode(str).replace(/%20/g,'_').replace(/%3B/g,';').replace(/%40/g,'@').replace(/%24/g,'$').replace(/%21/g,'!').replace(/%2A/g,'*').replace(/%28/g,'(').replace(/%29/g,')').replace(/%2C/g,',').replace(/%2F/g,'/').replace(/%3A/g,':');},getUrl:function(str,params){var url=mw.config.get('wgArticlePath').replace(
'$1',util.wikiUrlencode(typeof str==='string'?str:mw.config.get('wgPageName')));if(params&&!$.isEmptyObject(params)){url+=(url.indexOf('?')!==-1?'&':'?')+$.param(params);}return url;},wikiScript:function(str){str=str||'index';if(str==='index'){return mw.config.get('wgScript');}else if(str==='load'){return mw.config.get('wgLoadScript');}else{return mw.config.get('wgScriptPath')+'/'+str+mw.config.get('wgScriptExtension');}},addCSS:function(text){var s=mw.loader.addStyleTag(text);return s.sheet||s.styleSheet||s;},getParamValue:function(param,url){if(url===undefined){url=location.href;}var re=new RegExp('^[^#]*[&?]'+$.escapeRE(param)+'=([^&#]*)'),m=re.exec(url);if(m){return decodeURIComponent(m[1].replace(/\+/g,'%20'));}return null;},$content:null,addPortletLink:function(portlet,href,text,id,tooltip,accesskey,nextnode){var $item,$link,$portlet,$ul;if(arguments.length<3){return null;}$link=$('<a>').attr('href',href).text(text);if(tooltip){$link.attr('title',tooltip);}$portlet=$('#'+portlet)
;if($portlet.length===0){return null;}$ul=$portlet.find('ul').eq(0);if($ul.length===0){$ul=$('<ul>');if($portlet.find('div:first').length===0){$portlet.append($ul);}else{$portlet.find('div').eq(-1).append($ul);}}if($ul.length===0){return null;}$portlet.removeClass('emptyPortlet');if($portlet.hasClass('vectorTabs')){$item=$link.wrap('<li><span></span></li>').parent().parent();}else{$item=$link.wrap('<li></li>').parent();}if(id){$item.attr('id',id);}if(accesskey){$link.attr('accesskey',accesskey);}if(tooltip){$link.attr('title',tooltip);}if(nextnode){if(nextnode.nodeType||typeof nextnode==='string'){nextnode=$ul.find(nextnode);}else if(!nextnode.jquery){nextnode=undefined;}if(nextnode&&(nextnode.length!==1||nextnode[0].parentNode!==$ul[0])){nextnode=undefined;}}if(nextnode){nextnode.before($item);}else{$ul.append($item);}$link.updateTooltipAccessKeys();return $item[0];},validateEmail:function(mailtxt){var rfc5322Atext,rfc1034LdhStr,html5EmailRegexp;if(mailtxt===''){return null;}
rfc5322Atext='a-z0-9!#$%&\'*+\\-/=?^_`{|}~';rfc1034LdhStr='a-z0-9\\-';html5EmailRegexp=new RegExp('^'+'['+rfc5322Atext+'\\.]+'+'@'+'['+rfc1034LdhStr+']+'+'(?:\\.['+rfc1034LdhStr+']+)*'+'$','i');return(mailtxt.match(html5EmailRegexp)!==null);},isIPv4Address:function(address,allowBlock){if(typeof address!=='string'){return false;}var block=allowBlock?'(?:\\/(?:3[0-2]|[12]?\\d))?':'',RE_IP_BYTE='(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|0?[0-9]?[0-9])',RE_IP_ADD='(?:'+RE_IP_BYTE+'\\.){3}'+RE_IP_BYTE;return address.search(new RegExp('^'+RE_IP_ADD+block+'$'))!==-1;},isIPv6Address:function(address,allowBlock){if(typeof address!=='string'){return false;}var block=allowBlock?'(?:\\/(?:12[0-8]|1[01][0-9]|[1-9]?\\d))?':'',RE_IPV6_ADD='(?:'+':(?::|(?::'+'[0-9A-Fa-f]{1,4}'+'){1,7})'+'|'+'[0-9A-Fa-f]{1,4}'+'(?::'+'[0-9A-Fa-f]{1,4}'+'){0,6}::'+'|'+'[0-9A-Fa-f]{1,4}'+'(?::'+'[0-9A-Fa-f]{1,4}'+'){7}'+')';if(address.search(new RegExp('^'+RE_IPV6_ADD+block+'$'))!==-1){return true;}RE_IPV6_ADD=
'[0-9A-Fa-f]{1,4}'+'(?:::?'+'[0-9A-Fa-f]{1,4}'+'){1,6}';return address.search(new RegExp('^'+RE_IPV6_ADD+block+'$'))!==-1&&address.search(/::/)!==-1&&address.search(/::.*::/)===-1;},isIPAddress:function(address,allowBlock){return util.isIPv4Address(address,allowBlock)||util.isIPv6Address(address,allowBlock);}};mw.log.deprecate(util,'wikiGetlink',util.getUrl,'Use mw.util.getUrl instead.');mw.log.deprecate(util,'tooltipAccessKeyPrefix',$.fn.updateTooltipAccessKeys.getAccessKeyPrefix(),'Use jquery.accessKeyLabel instead.');mw.log.deprecate(util,'tooltipAccessKeyRegexp',/\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/,'Use jquery.accessKeyLabel instead.');mw.log.deprecate(util,'updateTooltipAccessKeys',function($nodes){if(!$nodes){if(document.querySelectorAll){$nodes=$(document.querySelectorAll('[accesskey]'));}else{$nodes=$('#column-one a, #mw-head a, #mw-panel a, #p-logo a, input, label, button');}}else if(!($nodes instanceof $)){$nodes=$($nodes);}$nodes.updateTooltipAccessKeys();},
'Use jquery.accessKeyLabel instead.');mw.log.deprecate(util,'jsMessage',function(message){if(!arguments.length||message===''||message===null){return true;}if(typeof message!=='object'){message=$.parseHTML(message);}mw.notify(message,{autoHide:true,tag:'legacy'});return true;},'Use mw.notify instead.');mw.util=util;}(mediaWiki,jQuery));});mw.loader.implement("mediawiki.action.view.redirect",function($,jQuery){(function(mw,$){var profile=$.client.profile(),canonical=mw.config.get('wgInternalRedirectTargetUrl'),fragment=null,shouldChangeFragment,index;index=canonical.indexOf('#');if(index!==-1){fragment=canonical.slice(index);}shouldChangeFragment=fragment&&!location.hash;if(canonical&&history.replaceState){if(!shouldChangeFragment){canonical=canonical.replace(/#.*$/,'');canonical+=location.hash;}history.replaceState(history.state,document.title,canonical);if(shouldChangeFragment&&profile.name==='msie'&&profile.versionNumber>=10){location.hash=fragment;}}else if(shouldChangeFragment){if(
profile.layout==='webkit'&&profile.layoutVersion<420){return;}location.hash=fragment;}if(shouldChangeFragment&&profile.layout==='gecko'){$(function(){if(location.hash===fragment){location.hash=fragment;}});}}(mediaWiki,jQuery));});mw.loader.implement("mediawiki.language.init",function($,jQuery){(function(mw){mw.language={data:{},getData:function(langCode,dataKey){var langData=mw.language.data;langCode=langCode.toLowerCase();if(langData&&langData[langCode]instanceof mw.Map){return langData[langCode].get(dataKey);}return undefined;},setData:function(langCode,dataKey,value){var langData=mw.language.data;langCode=langCode.toLowerCase();if(!(langData[langCode]instanceof mw.Map)){langData[langCode]=new mw.Map();}langData[langCode].set(dataKey,value);}};}(mediaWiki));});mw.loader.implement("mmv.base",function($,jQuery){(function(mw){mw.mmv={isBrowserSupported:function(){var ns={'svg':'http://www.w3.org/2000/svg'};return!!document.createElementNS&&!!document.createElementNS(ns.svg,'svg').
createSVGRect;}};}(mediaWiki));});
/* cache key: zhwiki:resourceloader:filter:minify-js:7:685d7160db260b1ad9de58b4113377fc */